{% extends 'window.twig' %}
{% block body %}
<div class="admin-main-container">
    <div class="node-list in data-view">
        <form action="auth.group.setAccess" method="post" class="form-horizontal auth-form">
            {% for r_t in rules %}
            <dl class="checkmod">
                <dt class="hd">
                    <label class="checkbox">
                        <input {{ r_t.checked?'checked="checked"':'' }} class="auth_rules rules_all check-all" data-target=".r_p_{{ r_t.id }}" type="checkbox" name="rules[]" value="{{ r_t.id }}">{{ r_t.title }}
                    </label>
                </dt>
                <dd class="bd">
                    {% for r_g in r_t.child %}
                    <div class="rule_check">
                        <div>
                            <label class="checkbox">
                                <input {{ r_g.checked?'checked="checked"':'' }} class="auth_rules rules_row r_p_{{ r_t.id }} check-all" data-target=".r_p_{{ r_g.id }}" type="checkbox" name="rules[]" value="{{ r_g.id }}">{{ r_g.title }}
                            </label>
                        </div>
                        <span class="divsion">&nbsp;</span>
                        <span class="child_row">
                            {% for r in r_g.child %}
                            <label class="checkbox" data-hasqtip="11" oldtitle="这是测试信息" title="">
                                <input {{ r.checked?'checked="checked"':'' }} class="auth_rules r_p_{{ r_t.id }}  r_p_{{ r_g.id }}" type="checkbox" name="rules[]" value="{{ r.id }}">{{ r.title }}
                            </label>
                            {% endfor %}
                        </span>
                    </div>
                    {% endfor %}
                </dd>
            </dl>
            {% endfor %}
            <input type="hidden" name="gid" value="{{ group.id }}"/>
            <button type="submit" class="btn btn-default submit-btn ajax-post" target-form="auth-form">确 定</button>
            <button class="btn btn-info btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
        </form>
    </div>
    <div style="height: 30px;"></div>
</div>
{% endblock %}
{% block style %}
    <style type="text/css">
        .node-list label[class=checkbox]{padding-top: 0;display: inline-block;margin-left: 20px;}
        .node-list input[type=checkbox]{margin-top: 8px;}
            /* 授权编辑页*/.checkmod{margin-bottom: 20px;border: 1px solid #ebebeb;}
        .checkmod dt{padding-left: 10px;height: 30px;line-height: 30px;font-weight: bold;border-bottom: 1px solid #ebebeb;background-color: #ECECEC;}
        .checkmod dd{padding-left: 10px;line-height: 30px;}
        .checkmod dd .checkbox{margin: 0 10px 0 20px;}
        .checkmod dd .divsion{margin-right: 20px;display: none;}
        .child_row{margin: 0 0 0 20px;display: block;}
    </style>
{% endblock %}